package com.elink.enginerring.util;

import javax.servlet.ServletContext;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class SpringMVCUtils {
	public static Object getBeanByName(ServletContext context,String beanName) {
		WebApplicationContext webApplicationContext = WebApplicationContextUtils.getWebApplicationContext(context);
		return webApplicationContext.getBean(beanName);
	}
}
